From 1811ef92771082054f79dfb8f00dfe23e1ecd023 Mon Sep 17 00:00:00 2001 From: George Dunlap Date: Tue, 14 Nov 2006 11:21:26 -0500 Subject: [PATCH] [XEN] Fix the "early unshadow" optimization to look at the entire pte. The optimization is designed to detect pagetable destruction, but re-uses the pagetable entries to store data under certain conditions (paging, zeroing, &c); sometimes the lower 8 bits are 0. These "false positives" cause unnecessary shadowing and unshadowing. Signed-off-by: George Dunlap --- xen/arch/x86/mm/shadow/multi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c index c8dfa28d6a..d199c90bfb 100644 --- a/xen/arch/x86/mm/shadow/multi.c +++ b/xen/arch/x86/mm/shadow/multi.c @@ -3778,7 +3778,7 @@ sh_x86_emulate_write(struct vcpu *v, unsigned long vaddr, void *src, shadow_validate_guest_pt_write(v, mfn, addr, bytes_on_page); bytes -= bytes_on_page; /* If we are writing zeros to this page, might want to unshadow */ - if ( *(u8 *)addr == 0 ) + if ( *(u32 *)addr == 0 ) check_for_early_unshadow(v, mfn); sh_unmap_domain_page(addr); } -- 2.30.2